package com.wondedDream.repository;

import com.wondedDream.model.Practice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PracticeRepository extends JpaRepository<Practice, Integer> {

    // 新增的自定义查询方法
    @Query("SELECT c FROM Practice c WHERE c.category.id = :categoryId")
    List<Practice> findByCategoryId(Integer categoryId);
}